package com.yonyou.ncmm_pac_pda;

import com.yonyou.uap.um.application.ApplicationContext;
import com.yonyou.uap.um.base.*;
import com.yonyou.uap.um.common.*;
import com.yonyou.uap.um.third.*;
import com.yonyou.uap.um.control.*;
import com.yonyou.uap.um.core.*;
import com.yonyou.uap.um.binder.*;
import com.yonyou.uap.um.runtime.*;
import com.yonyou.uap.um.lexer.*;
import com.yonyou.uap.um.widget.*;
import com.yonyou.uap.um.widget.UmpSlidingLayout.SlidingViewType;
import com.yonyou.uap.um.log.ULog;
import java.util.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import android.webkit.*;
import android.content.*;
import android.graphics.*;
import android.widget.ImageView.ScaleType;

public abstract class ConnectTestActivity extends UMWindowActivity {

	protected UMWindow ConnectTest = null;
protected XVerticalLayout viewPage0 = null;
protected XHorizontalLayout navigatorbar0 = null;
protected UMButton btnback = null;
protected UMLabel label0 = null;
protected UMScrollView Scrollview_wpanelsetting = null;
protected XVerticalLayout wpanelsetting = null;
protected XHorizontalLayout wpanel4 = null;
protected UMLabel wlabel8 = null;
protected UMLabel wlabel9 = null;
protected UMTextbox txthost = null;
protected UMLabel label1 = null;
protected UMTextbox txtport = null;
protected XVerticalLayout wpanel5 = null;
protected UMButton btntestconn = null;

	
	protected final static int ID_CONNECTTEST = 511775266;
protected final static int ID_VIEWPAGE0 = 190346846;
protected final static int ID_NAVIGATORBAR0 = 1306239568;
protected final static int ID_BTNBACK = 676146970;
protected final static int ID_LABEL0 = 1123512405;
protected final static int ID_SCROLLVIEW_WPANELSETTING = 48824790;
protected final static int ID_WPANELSETTING = 155159918;
protected final static int ID_WPANEL4 = 1211162897;
protected final static int ID_WLABEL8 = 1987172832;
protected final static int ID_WLABEL9 = 1985506433;
protected final static int ID_TXTHOST = 941186855;
protected final static int ID_LABEL1 = 240344752;
protected final static int ID_TXTPORT = 1948995920;
protected final static int ID_WPANEL5 = 712315335;
protected final static int ID_BTNTESTCONN = 585902912;

	
	
	@Override
	public String getControllerName() {
		return "ConnectTestController";
	}
	
	@Override
	public String getContextName() {
		return "";
	}

	@Override
	public String getNameSpace() {
		return "com.yonyou.ncmm_pac_pda";
	}

	protected void onCreate(Bundle savedInstanceState) {
		ULog.logLC("onCreate", this);
		super.onCreate(savedInstanceState);
        onInit(savedInstanceState);
        
	}
	
	@Override
	protected void onStart() {
		ULog.logLC("onStart", this);
		
		super.onStart();
	}

	@Override
	protected void onRestart() {
		ULog.logLC("onRestart", this);
		
		super.onRestart();
	}

	@Override
	protected void onResume() {
		ULog.logLC("onResume", this);
		
		super.onResume();
	}

	@Override
	protected void onPause() {
		ULog.logLC("onPause", this);
		
		super.onPause();
	}

	@Override
	protected void onStop() {
		ULog.logLC("onStop", this);
		
		super.onStop();
	}

	@Override
	protected void onDestroy() {
		ULog.logLC("onDestroy", this);
		
		super.onDestroy();
	}
	
	public  void onInit(Bundle savedInstanceState) {
		ULog.logLC("onInit", this);
		UMActivity context = this;
		registerControl();
		this.getContainer();
		
		/*
		 new Thread() {
			 public void run() {
				 UMPDebugClient.startServer();
			 }
		 }.start();
		*/
		String sys_debug = ApplicationContext.getCurrent(this).getValue("sys_debug");
		if (sys_debug != null && sys_debug.equalsIgnoreCase("true")) {
			UMPDebugClient.waitForDebug();
		}

		IBinderGroup binderGroup = this;
		currentPage = getCurrentWindow(context, binderGroup);
super.setContentView(currentPage);

		
	}
	
	private void registerControl() {
		  idmap.put("ConnectTest",ID_CONNECTTEST);
  idmap.put("viewPage0",ID_VIEWPAGE0);
  idmap.put("navigatorbar0",ID_NAVIGATORBAR0);
  idmap.put("btnback",ID_BTNBACK);
  idmap.put("label0",ID_LABEL0);
  idmap.put("Scrollview_wpanelsetting",ID_SCROLLVIEW_WPANELSETTING);
  idmap.put("wpanelsetting",ID_WPANELSETTING);
  idmap.put("wpanel4",ID_WPANEL4);
  idmap.put("wlabel8",ID_WLABEL8);
  idmap.put("wlabel9",ID_WLABEL9);
  idmap.put("txthost",ID_TXTHOST);
  idmap.put("label1",ID_LABEL1);
  idmap.put("txtport",ID_TXTPORT);
  idmap.put("wpanel5",ID_WPANEL5);
  idmap.put("btntestconn",ID_BTNTESTCONN);

	}
	
	public void onLoad() {
		ULog.logLC("onLoad", this);
		if(currentPage!=null) {
			currentPage.onLoad();
		}
	
		{ //wpanelsetting - action:wpanelsetting_onload
    UMEventArgs args = new UMEventArgs(ConnectTestActivity.this);
    actionWpanelsetting_onload(wpanelsetting,args);

}

	}
	
	public void onDatabinding() {
		ULog.logLC("onDatabinding", this);
		super.onDatabinding();
		
	}
	
	@Override
	public void onReturn(String methodName, Object returnValue) {
		
	}

	@Override
	public void onAfterInit() {
		ULog.logLC("onAfterInit", this);
		
		onLoad();
	}
	
		@Override
	public Map<String,String> getPlugout(String id) {
		XJSON from = this.getUMContext();
		Map<String,String> r = super.getPlugout(id);
		
		return r;	
	}
	
	
	
	public View getNavigatorbar0View(final UMActivity context,IBinderGroup binderGroup) {
navigatorbar0 = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_NAVIGATORBAR0
,"color","#323232"
,"padding-left","8"
,"font-size","17"
,"valign","center"
,"title","登录设置"
,"width","fill"
,"font-family","default"
,"background-image","navbar_login.png"
,"layout-type","vbox"
,"halign","LEFT"
,"padding-right","8"
,"height","44.0"
);
btnback = (UMButton)ThirdControl.createControl(new UMButton(context),ID_BTNBACK
,"font-pressed-color","#e50011"
,"color","#ffffff"
,"onclick","action:btnback_onclick"
,"width","44"
,"font-size","20"
,"font-family","default"
,"valign","center"
,"background-image","icon_back.png"
,"layout-type","hbox"
,"halign","center"
,"height","44"
);
navigatorbar0.addView(btnback);
label0 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL0
,"width","0"
,"weight","1"
,"font-family","default"
,"valign","center"
,"layout-type","hbox"
,"halign","center"
,"height","fill"
);
navigatorbar0.addView(label0);

return navigatorbar0;
}
public View getWpanel4View(final UMActivity context,IBinderGroup binderGroup) {
wpanel4 = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_WPANEL4
,"width","fill"
,"valign","center"
,"background-image","list_row_down1.png"
,"layout-type","vbox"
,"halign","LEFT"
,"height","44"
);
wlabel8 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_WLABEL8
,"color","#000000"
,"width","70"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","hbox"
,"halign","right"
,"content","服务器"
,"margin-right","10"
,"height","20"
);
wpanel4.addView(wlabel8);
wlabel9 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_WLABEL9
,"color","#000000"
,"background","#c0c0c0"
,"width","1"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","hbox"
,"halign","center"
,"content","label"
,"height","35"
);
wpanel4.addView(wlabel9);
txthost = (UMTextbox)ThirdControl.createControl(new UMTextbox(context),ID_TXTHOST
,"color","#167ef8"
,"maxlength","256"
,"padding-left","4"
,"font-size","17"
,"margin-right","2"
,"bindfield","host"
,"background","#ffffff"
,"width","180.0"
,"font-family","default"
,"placeholder","NC服务器IP"
,"layout-type","hbox"
,"halign","LEFT"
,"height","40.0"
);
wpanel4.addView(txthost);
label1 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL1
,"color","#000000"
,"font-weight","bold"
,"font-size","20"
,"valign","center"
,"widthwrap","7.0"
,"content",":"
,"heightwrap","29.0"
,"width","wrap"
,"font-family","default"
,"layout-type","hbox"
,"halign","center"
,"height","wrap"
);
wpanel4.addView(label1);
txtport = (UMTextbox)ThirdControl.createControl(new UMTextbox(context),ID_TXTPORT
,"color","#167ef8"
,"maxlength","256"
,"padding-left","4"
,"font-size","17"
,"margin-left","2"
,"bindfield","port"
,"background","#ffffff"
,"width","100.0"
,"font-family","default"
,"placeholder","端口号"
,"layout-type","hbox"
,"halign","LEFT"
,"height","40.0"
);
wpanel4.addView(txtport);

return wpanel4;
}
public View getWpanel5View(final UMActivity context,IBinderGroup binderGroup) {
wpanel5 = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_WPANEL5
,"width","fill"
,"valign","CENTER"
,"layout-type","vbox"
,"halign","right"
,"height","40"
);
btntestconn = (UMButton)ThirdControl.createControl(new UMButton(context),ID_BTNTESTCONN
,"padding-top","2"
,"font-pressed-color","#e50011"
,"color","#ffffff"
,"onclick","action:btntestconn_onclick"
,"padding-left","2"
,"font-size","17"
,"padding-bottom","2"
,"valign","center"
,"widthwrap","76.0"
,"margin-right","10"
,"heightwrap","29.0"
,"background","#f7931e"
,"width","wrap"
,"font-family","default"
,"layout-type","vbox"
,"halign","center"
,"value","测试连接"
,"height","wrap"
,"padding-right","2"
);
wpanel5.addView(btntestconn);

return wpanel5;
}
public View getWpanelsettingView(final UMActivity context,IBinderGroup binderGroup) {
wpanelsetting = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_WPANELSETTING
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"onload","action:wpanelsetting_onload"
,"height","wrap"
);
View wpanel4 = (View) getWpanel4View((UMActivity)context,binderGroup);
wpanelsetting.addView(wpanel4);
View wpanel5 = (View) getWpanel5View((UMActivity)context,binderGroup);
wpanelsetting.addView(wpanel5);

return wpanelsetting;
}
public View getScrollview_wpanelsettingView(final UMActivity context,IBinderGroup binderGroup) {
Scrollview_wpanelsetting = (UMScrollView)ThirdControl.createControl(new UMScrollView(context),ID_SCROLLVIEW_WPANELSETTING
,"layout","vbox"
,"width","fill"
,"hscrollenabled","disabled"
,"layout-type","vbox"
,"height","fill"
);
View wpanelsetting = (View) getWpanelsettingView((UMActivity)context,binderGroup);
Scrollview_wpanelsetting.addView(wpanelsetting);

return Scrollview_wpanelsetting;
}
public View getViewPage0View(final UMActivity context,IBinderGroup binderGroup) {
viewPage0 = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_VIEWPAGE0
,"background","#F5F5F5"
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"content","                    ﻿    "
,"height","fill"
);
View navigatorbar0 = (View) getNavigatorbar0View((UMActivity)context,binderGroup);
viewPage0.addView(navigatorbar0);
View Scrollview_wpanelsetting = (View) getScrollview_wpanelsettingView((UMActivity)context,binderGroup);
viewPage0.addView(Scrollview_wpanelsetting);

return viewPage0;
}
public UMWindow getCurrentWindow(final UMActivity context,IBinderGroup binderGroup) {
ConnectTest = (UMWindow)ThirdControl.createControl(new UMWindow(context),ID_CONNECTTEST
,"layout","vbox"
,"controller","ConnectTestController"
,"namespace","com.yonyou.ncmm_pac_pda"
,"width","fill"
,"valign","TOP"
,"layout-type","linear"
,"halign","center"
,"height","fill"
);
View viewPage0 = (View) getViewPage0View((UMActivity)context,binderGroup);
ConnectTest.addView(viewPage0);

return (UMWindow)ConnectTest;
}

	
	public void actionWpanelsetting_onload(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "wpanelsetting_onload";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.wpanelsetting_onload()",UMActivity.getViewId(control),args);
}
public void actionBtntestconn_onclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "btntestconn_onclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.btntestconn_onclick()",UMActivity.getViewId(control),args);
}
public void actionBtnback_onclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "btnback_onclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.btnback_onclick()",UMActivity.getViewId(control),args);
}


}
